﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="selectMovie.aspx.cs" Inherits="Joyintech.Admin.inpiao365.core.selectMovie" %>

<%@ Register Src="~/checkRight.ascx" TagName="checkRight" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>电影选择</title>
</head>
<body>
    <form id="form1" runat="server">
    <div class="position">
        <span>电影选择</span>
    </div>
    <div class="searcher">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td class="fontR">
                    电影名称:<jui:HFTextBox ID="txtmovieName" runat="server"></jui:HFTextBox>
                    &nbsp;
                    <jui:HFLinkButton runat="server" ID="btnSearch" CssClass="btn" OnClick="btnSearch_Click"><span><label class="search" for="btnSearch">查询</label></span></jui:HFLinkButton>
            </tr>
        </table>
    </div>
    <div class="lister">
        <table border="0" cellpadding="0" cellspacing="1" width="100%" class="datatable">
            <tr class="head">
                <td class="fontC">
                    电影名称
                </td>
                <td class="fontC">
                    导演
                </td>
                <td class="fontC">
                    上映日期
                </td>
                <td class="fontC">
                    片长
                </td>
                <td style="width: 10%" class="fontC">
                    操作
                </td>
            </tr>
            <asp:Repeater ID="RepeaterList" runat="server">
                <ItemTemplate>
                    <tr class="row1" onmouseover="a=this.className;this.className='rowfocus';" onmouseout="this.className=a;a='';">
                        <td class="fontL">
                            <%# Eval("MovieName")%>
                        </td>
                        <td class="fontL">
                            <%# Eval("Director")%>
                        </td>
                        <td class="fontC">
                            <%# Eval("ReleaseDate","{0:yyyy-MM-dd}")%>
                        </td>
                        <td class="fontC">
                            <%# Eval("Trailer")%>
                        </td>
                        <td style="width: 10%" class="fontC">
                            <input id="Checkbox1" type="checkbox" value="<%# Eval("movieId") + "," + Eval("MovieName") %>" />
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr class="row2" onmouseover="a=this.className;this.className='rowfocus';" onmouseout="this.className=a;a='';">
                        <td class="fontL">
                            <%# Eval("MovieName")%>
                        </td>
                        <td class="fontL">
                            <%# Eval("Director")%>
                        </td>
                        <td class="fontC">
                            <%# Eval("ReleaseDate","{0:yyyy-MM-dd}")%>
                        </td>
                        <td class="fontC">
                            <%# Eval("Trailer")%>
                        </td>
                        <td style="width: 10%" class="fontC">
                            <input id="Checkbox1" type="checkbox" value="<%# Eval("movieId") + "," + Eval("MovieName") %>" />
                        </td>
                    </tr>
                </AlternatingItemTemplate>
            </asp:Repeater>
            <%if (RepeaterList.Items.Count == 0)
              {%>
            <tr class="row1">
                <td colspan="5" align="center">
                    无符合条件的数据
                </td>
            </tr>
            <%}%>
            <tr class="pager">
                <td colspan="5">
                    <jui:SqlPager ID="SqlPager1" ControlToPaginate="RepeaterList" ItemsPerPage="50" PagingMode="NonCached"
                        runat="server" />
                </td>
            </tr>
        </table>
    </div>
    <uc1:checkRight ID="checkRight1" runat="server" />
    </form>
</body>
</html>
<script language="javascript" type="text/javascript">
    var DG = frameElement.lhgDG;

    function ok() {
        var Ids = "", MovieNames = "";
        var oo = document.getElementsByTagName("input");
        for (var k = 0, len = oo.length; k < len; k++) {
            var e = oo[k];
            if (e.type == "checkbox") {
                if (e.checked) {
                    var items = e.value.split(',');
                    Ids = Ids + items[0] + ",";
                    MovieNames = MovieNames + items[1] + "\n";
                }
            }
        }

        if (Ids.length > 0) {
            Ids = Ids.substring(0, Ids.length - 1);
            MovieNames = MovieNames.substring(0, MovieNames.length - 1);
        }

        J('#hidMovieIds', DG.curDoc).val(Ids);
        J('#txtSelectMovie', DG.curDoc).val(MovieNames);
        DG.cancel();
    }

    DG.addBtn('save', '确定', ok);

    function opdg(id) {
        var opwin = new J.dialog({ btnBar: false, id: id, title: '电影选择', page: 'edit.aspx?user_id=' + id, cover: true, width: 600, height: 450, lockScroll: true, drag: false, cancelBtn: false });
        opwin.ShowDialog();
    }
</script>
